﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// 用于密码保护功能的启用
/// 在发送电子邮件成功之后会调用本页面
/// 需要GET参数：
/// emailAddress —— 用户的email地址，用于显示信息和指向邮箱运营商的链接
/// </summary>
public partial class emailSent : System.Web.UI.Page
{
    /// <summary>
    /// 将GET传入的email地址拆解，取其一级域名部分制作指向邮箱运营商的链接
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["emailAddress"] == null)
        {
            Response.Redirect("noGETParameter.html", true);
            return;
        }
        else
        {
            string emailAddress = Request.QueryString["emailAddress"];
            main.InnerHtml = "您的验证邮件已经成功发送到 " + emailAddress;
            string emailUrl = emailAddress.Split('@')[1];
            string emailProvider = emailUrl.Split('.')[0];
            emailUrl = "http://mail." + emailUrl;
            main.InnerHtml += "<br><a href=\"" + emailUrl + "\">登录" + emailProvider + "邮箱</a>";
        }
    }
}